{extend name="public:layout" /}
{block name="title"}添加模型{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> <a href="{:url('index')}"> 模型管理</a></li>
                <li class="active">添加模型</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">模型名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入模型名称"
                               name="moudle_name" datatype="*" />
                        <p class="help-block">请输入语义化名称</p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">模型表名</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入模型表名"
                               name="table_name" datatype="*" />
                        <p class="help-block">模型表名建议根据场景以前缀区分</p>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">列表模板</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入列表模板"
                               name="list_tpl" datatype="*" value="index" />
                        <p class="help-block">默认index模板系统已实现，自定义模板后请自行增加对应模板</p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">模型类型</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="is_bind" value="1" /> cms模型
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="is_bind" value="0" checked /> 独立模型
                        </label>
                        <p class="help-block">一个模型涉及分类的情况下使用cms模型</p>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">添加模板</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入添加模板"
                               name="add_tpl" datatype="*" value="add" />
                        <p class="help-block">默认add模板系统已实现，自定义模板后请自行增加对应模板</p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">编辑模板</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入编辑模板"
                               name="edit_tpl" datatype="*" value="edit" />
                        <p class="help-block">默认edit模板系统已实现，自定义模板后请自行增加对应模板</p>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">描述</label>
                    <div class="col-sm-10">
                         <textarea class="form-control" placeholder="请填写备注信息" rows="3"
                                   name="description"></textarea>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">系统模型</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="is_system" value="1" checked/> 是
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="is_system" value="0"/> 否
                        </label>
                        <p class="help-block">系统模型默认不允许删除</p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">状态</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="enable" value="1" checked/> 启用
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="enable" value="0"/> 禁用
                        </label>
                        <p class="help-block">禁用状态的模型保留功能但无法使用</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">排序</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入排序"
                               name="moudle_sort" datatype="n" value="0" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" id="btnSub" type="button">保存内容</button>
                        <a href="{:url('index')}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub')
    })
</script>
{/block}